<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<title>Форма регистрации пользователя</title>
</h:head>
<h:body>
	<h3>Регистрация пользователя</h3>
	<h:form id="registration-form">
		<h:panelGrid columns="2" style="width: 100%; ">
			<h:outputText value="Фамилия"></h:outputText>
			<p:inputText value="#{registrationBean.lastName}" id="lastName" />
			<h:outputText value="Имя"></h:outputText>
			<p:inputText value="#{registrationBean.firstName}" id="firstName" />		
			<h:outputText value="Отчество"></h:outputText>
			<p:inputText value="#{registrationBean.middleName}" id="middleName" />
			<h:outputText value="Структурное подразделение"></h:outputText>
			<p:commandButton value="Добавить" type="button" onclick="PF('dlg1').show();" />
			<h:outputText value="Должность"></h:outputText>
			<p:inputText value="#{registrationBean.officer}" id="officer" />
			<h:outputText value="Телефон"></h:outputText>
			<p:inputText value="#{registrationBean.phone}" id="phone" />
			<h:outputText value="Номер аттестата КИ"></h:outputText>
			<p:inputText value="#{registrationBean.attestat}" id="attestat" />
			<h:outputText value="Адрес"></h:outputText>
			<p:inputText value="#{registrationBean.address}" id="address" />
			<h:outputText value="Эл. почта"></h:outputText>
			<p:inputText value="#{registrationBean.email}" id="email" />
			<h:outputText value="Документ удостоверяющий личность"></h:outputText>
			<p:commandButton value="Добавить" type="button" onclick="PF('dlg2').show();" />
			<h:outputText value="Пользователь:"></h:outputText>
			<p:inputText  value="#{registrationBean.login}" id="login" />
			<h:outputText value="Пароль:"></h:outputText>
			<p:inputText  value="#{registrationBean.password}" id="password" />
			<p:commandButton id="button1" value="Отменить" action="#{navigationBean.toLogin}" ajax="false" />
			<p:commandButton id="button2" value="Сохранить" action="#{registrationBean.doSave}" ajax="false" />
		</h:panelGrid>		
	</h:form>
	<p:dialog header="Структурное подразделение" widgetVar="dlg1" modal="true" height="100">
		<h:outputText value="This is a Modal Dialog." />
	</p:dialog>
	<p:dialog header="Документ удостоверяющий личность" widgetVar="dlg2" modal="true" height="100">
		<h:outputText value="This is a Modal Dialog." />
	</p:dialog>
</h:body>
</html>